package com.cheetah.start;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.core.env.ConfigurableEnvironment;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.transaction.annotation.EnableTransactionManagement;

/**
 * 启动类
 *
 * @author Feel
 * @date 2021/09/20
 */
@Slf4j
@EnableAsync
@SpringBootApplication
@ServletComponentScan
@EnableTransactionManagement
public class FastApplication extends SpringBootServletInitializer {



    public static void main(String[] args) {
        SpringApplication app = new SpringApplication(FastApplication.class);
        ConfigurableEnvironment environment = app.run(args).getEnvironment();
        System.out.println(" ┌-------------------------cheetah启动成功---------------------------┐");
        System.out.println(" │                  页面地址: http://localhost:" + environment.getProperty("server.port") + "/login            │");
        System.out.println(" └-------------------------cheetah启动成功---------------------------┘");

    }

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
        return builder.sources(FastApplication.class);
    }
}
